// 关键字映射接口
export interface KeywordMapping {
    text: string;
    color?: string;
    fileSuffix?: string;//文件后缀，默认不限制，配置文件后缀时，只在对应后缀的文件中生效
}

// 关键字到中文的映射
export const keywordMap: { [key: string]: KeywordMapping } = {
    'abstract': { text: '抽象' },
    'assert': { text: '断言', fileSuffix: 'java,class' },
    'async': { text: '异步', fileSuffix: 'js,ts' },
    'await': { text: '等待', fileSuffix: 'js,ts' },
    '@interface': { text: '注解', fileSuffix: 'java,class' },
    '@Override': { text: '重写', fileSuffix: 'java,class' },
    '@Deprecated': { text: '已废弃', fileSuffix: 'java,class' },
    '@Suppresswarnings': { text: '@抑制警告', fileSuffix: 'java,class' },
    '@Safevarargs': { text: '@安全可变参数', fileSuffix: 'java,class' },
    '@Functionalinterface': { text: '@函数式接口', fileSuffix: 'java,class' },
    '@Retention': { text: '@保留策略', fileSuffix: 'java,class' },
    '@Target': { text: '@作用目标', fileSuffix: 'java,class' },
    '@Inherited': { text: '@继承', fileSuffix: 'java,class' },
    '@Documented': { text: '@文档化', fileSuffix: 'java,class' },
    '@Repeatable': { text: '@可重复', fileSuffix: 'java,class' },

    'break': { text: '中断' },

    'case': { text: '情况' },
    'catch': { text: '捕获异常' },

    'class': { text: '类' },
    'const': { text: '常量' },
    'console.log': { text: '控制台打印', color: '#b3a040' },
    'continue': { text: '继续' },
    'default': { text: '默认' },
    'do': { text: '执行', fileSuffix: 'java,class' },
    'double': { text: '双精度', fileSuffix: 'java,class' },
    'else': { text: '否则' },
    'enum': { text: '枚举', fileSuffix: 'java,class' },
    'extends': { text: '继承' },
    'export': { text: '导出' },
    'false': { text: '假' },
    'final': { text: '最终', fileSuffix: 'java,class' },
    'finally': { text: '最终' },
    'float': { text: '单精度', fileSuffix: 'java,class' },
    'for': { text: '循环' },
    'from': { text: '从', fileSuffix: 'js,ts' },
    'function': { text: '函数', color: '#b3a040' },
    'getter': { text: '获取', fileSuffix: 'js,ts' },
    'goto': { text: '跳转', fileSuffix: 'java,class' },
    'if': { text: '如果' },
    'implements': { text: '实现' },
    'import': { text: '导入' },
    'instanceof': { text: '实例' },
    'interface': { text: '接口' },
    'let': { text: '变量', color: '#b3a040' },
    'module': { text: '模块' },
    'namespace': { text: '命名空间', fileSuffix: 'ts' },
    'native': { text: '本地', fileSuffix: 'java,class' },
    'new': { text: '新建' },
    'null': { text: '空值' },
    'org.springframework': { text: 'spring框架', fileSuffix: 'java,class' },
    'com.google.gson': { text: 'Gson包', fileSuffix: 'java,class' },
    'com.fasterxml.jackson': { text: 'Jackson包', fileSuffix: 'java,class' },
    'org.apache.commons': { text: 'Apache通用包', fileSuffix: 'java,class' },

    // ElementType 枚举
    'ElementType.TYPE': { text: '类/接口', fileSuffix: 'java,class' },
    'ElementType.FIELD': { text: '字段', fileSuffix: 'java,class' },
    'ElementType.METHOD': { text: '方法', fileSuffix: 'java,class' },
    'ElementType.PARAMETER': { text: '参数', fileSuffix: 'java,class' },
    'ElementType.CONSTRUCTOR': { text: '构造器', fileSuffix: 'java,class' },
    'ElementType.LOCAL_VARIABLE': { text: '局部变量', fileSuffix: 'java,class' },
    'ElementType.ANNOTATION_TYPE': { text: '注解类型', fileSuffix: 'java,class' },
    'ElementType.PACKAGE': { text: '包', fileSuffix: 'java,class' },
    'ElementType.TYPE_PARAMETER': { text: '类型参数', fileSuffix: 'java,class' },
    'ElementType.TYPE_USE': { text: '类型使用', fileSuffix: 'java,class' },
    'ElementType.MODULE': { text: '模块', fileSuffix: 'java,class' },
    'ElementType.RECORD_COMPONENT': { text: '记录组件', fileSuffix: 'java,class' },

    // RetentionPolicy 枚举
    'RetentionPolicy.SOURCE': { text: '源码级', fileSuffix: 'java,class' },
    'RetentionPolicy.CLASS': { text: '类文件级', fileSuffix: 'java,class' },
    'RetentionPolicy.RUNTIME': { text: '运行时', fileSuffix: 'java,class' },

    'package': { text: '包', fileSuffix: 'java,class' },
    'private': { text: '私有' },
    'protected': { text: '保护' },
    'public': { text: '公开' },
    'readonly': { text: '只读', fileSuffix: 'ts,js' },
    'require': { text: '引入', fileSuffix: 'js' },
    'return': { text: '返回' },
    'setter': { text: '设置', fileSuffix: 'js,ts' },

    'static': { text: '静态' },
    'System.out.println': { text: '控制台打印', color: '#b3a040', fileSuffix: 'java,class' },
    'strictfp': { text: '严格浮点', fileSuffix: 'java,class' },

    'super': { text: '父类' },
    'switch': { text: '选择判定' },
    'synchronized': { text: '同步', fileSuffix: 'java,class' },
  
    'throw': { text: '抛出' },
    'throws': { text: '抛出异常', fileSuffix: 'java,class' },
    'transient': { text: '不序列化', fileSuffix: 'java,class' },
    'true': { text: '真' },
    'try': { text: '尝试' },
    'type': { text: '类型' },
    'typeof': { text: '取类型', fileSuffix: 'js,ts' },
    'undefined': { text: '未定义', fileSuffix: 'js,ts' },
    'volatile': { text: '易变', fileSuffix: 'java,class' },
    'void': { text: '无返回值', fileSuffix: 'java,class' },
    'while': { text: '当' }
};